package it.aekidna.cleverplatypus.utils
{
	import mx.collections.ArrayCollection;

	public class ArrayCollectionUtils
	{
		public static function setItemsFromList( inDestination : ArrayCollection, inSource : Object ) : void
		{
			if( !inDestination )
				return;

			inDestination.removeAll();

			if( inSource && ( inSource is Array || inSource is ArrayCollection ))
			{
				for each( var item : Object in inSource )
				{
					inDestination.addItem( item );
				}
			}
		}


		public static function addItemsFromList( inDestination : ArrayCollection, inSource : Object ) : void
		{
			if( inSource is Array || inSource is ArrayCollection )
			{
				for each( var item : Object in inSource )
				{
					inDestination.addItem( item );
				}
			}
		}
	}
}